<template>
	<view class="index-section">
		<view class="title">
			<tit tit="相关视频" url="/pages/home/videoList" />
		</view>
		<view class="main" v-if="list.file">
			<video :src="$imageOss(list.file)" class="image" :poster="$imageOss(list.image)" style="width: 100%;"></video>
		</view>
	</view>
</template>

<script>
	import tit from '@/pages/index/cpns/title.vue';
	import config from "@/request/baseUrl.js";
	import {
		videoList
	} from "@/request/homeApi.js";

	export default {
		components: {
			tit,
		},
		data() {
			return {
				baseUrl: config.baseUrl,
				list: null,
			};
		},
		mounted() {
			// this.getList()
		},
		methods: {
			toDetails(e) {
				uni.navigateTo({
					url: '/pages/home/webview/webview?url=' + e.link
				})
			},
			getList() {
				let that = this
				videoList({
					page:1,
					limit:1,
					title:''
				}).then(res => {
					if(res.code == 200){
						that.list = res.data.list[0]
					}
				});
			},

		}
	}
</script>

<style lang="scss" scoped>
	.index-section {
		.title {
			padding: 20rpx;
			margin-top: 20rpx;
			background-color: #fff;
		}

		.main {
			margin: 20rpx;
			text-align: center;
			.image {
				width: 100%;
				height: 400rpx !important;
			}
		}
	}
</style>
